<template>
	<view class="">
		<cu-custom bgColor="bg-white" :isBack="true">
			<block slot="backText">返回</block>
			<block slot="content">{{title}}</block>
		</cu-custom>

		<view class="cu-list menu margin-top">

			<view class="cu-item arrow" @click="jumpFn('avatar')">
				<view class="content">
					<text class="cuIcon-emojiflashfill text-pink"></text>
					<text class="text-grey">头像</text>
				</view>
				<view class="cu-avatar round xs" style="background-image:url('../../static/img/portrait.png');"></view>
			</view>
			<view class="cu-item" :class="menuArrow?'arrow':''" @click="jumpFn('avatar')">
				<view class="content">
					<text class="cuIcon-tagfill text-red  margin-right-xs"></text>
					<text class="text-grey">用户名称</text>
				</view>
				<view class="action">
					<text class="padding-sm"> {{userInfo.username || ""}}</text>
					<view class="cu-tag round bg-orange light"> 切换用户名</view>

				</view>
			</view>

			<view class="cu-item" @click="jumpFn('avatar')">
				<view class="content">
					<text class="cuIcon-card text-green"></text>
					<text class="text-grey">身份证</text>
				</view>
				<view class="action">
					<text class="text-grey text-sm"></text>
				</view>
			</view>
			<view class="cu-item" @click="jumpFn('avatar')">
				<view class="content">
					<text class="cuIcon-mobile text-green"></text>
					<text class="text-grey">手机</text>
				</view>
				<view class="action">
					<text class="text-grey text-sm">{{userInfo.mobile || ""}}</text>
				</view>
			</view>
			<view class="cu-item" @click="jumpFn('avatar')">
				<view class="content">
					<text class="cuIcon-pay text-green"></text>
					<text class="text-grey">支付宝</text>
				</view>
				<view class="action">
					<text class="text-grey text-sm"></text>
				</view>
			</view>
			<view class="cu-item" @click="jumpFn('avatar')">
				<view class="content">
					<text class="cuIcon-card text-green"></text>
					<text class="text-grey">银行卡号</text>
				</view>
				<view class="action">
					<text class="text-grey text-sm"></text>
				</view>
			</view>
			<view class="cu-item arrow" @click="jumpFn('editPass')">
				<view class="content">
					<text class="cuIcon-edit text-green"></text>
					<text class="text-grey">修改密码</text>
				</view>

			</view>

		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				title: "设置",
				userInfo:{},


			}

		},
		onLoad() {
			this.$Reques.request(this.$Reques.interface_url.userInfo, "GET", "").then((res) => {
				console.log(res);
				if (res.status == 200) {
					this.userInfo=res.data;
				}else{
					this.$Reques.showToast(res.message);
				}
			})
			
		},
		mounted() {

		},
		methods: {
			jumpFn(type) {
				
				switch (type) {
					case "avatar":

						this.$Reques.showToast("暂未开放");

						break;

					case "card":


						break;

					case "editPass":
					     uni.navigateTo({
					     	url:"/pages/user/editpass"
					     })

						break;


				}

			}




		}





	}
</script>

<style>
</style>
